import Vuex from 'vuex'
import Vue from 'vue'
import circle from './modules/circle.js'

Vue.use(Vuex)

const vuexStore = new Vuex.Store({
  state: {
    // 用户基本信息
    userInfo: {
      avatar: '',
      nickName: ''
    },
    userDetailInfo: null,
    unionid: '123456',
    openid: '123456',
    loading: false,
    makingIn: false,

    userUpImg: null,
    userHead: null,
    userClothes: null,
    userImg: null,
    userAvatar: null,

    firstUrl: '', // ios微信内，首次进入应用的链接
    init: null,
    regToUrl: '/', // 进入注册前用户点击的页面
    regIsSubmit: false// 注册是否提交
  },
  mutations: {
    setUrl (state, url) {
      state.firstUrl = url
    },
    setLoading (state, type) {
      state.loading = type
    },
    setInit (state, data) {
      state.init = data
    },
    setUserInfoDetail (state, userInfoDetail) {
      state.userDetailInfo = userInfoDetail
    }
  },
  getters: {
  },
  modules: {
    circle
  }
})
export default vuexStore
